package org.spring.springboot.app.sys.role.domain.vo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.util.List;

@ApiModel(description = "角色")
public class SysRoleReqVO {

    @ApiModelProperty(value = "id(添加时不传)", hidden = false)
    private String id;

    @ApiModelProperty(required = true, value = "上级角色ID", hidden = false)
    private String parentId;

    @ApiModelProperty(required = true, value = "角色名称", hidden = false)
    @NotNull(message = "角色名不能为空")
    @Length(max=10,message = "角色名最多10个字符")
    private String name;

    @ApiModelProperty(required = true, value = "英文名称", hidden = false)
    private String enname;

    @ApiModelProperty(required = true, value = "是否可用", hidden = false)
    @NotNull(message = "角色状态不能为空")
    @Pattern(regexp = "^[0,1]$",message = "角色状态只能是0或者1")
    private String useable;

    @ApiModelProperty(required = true, value = "角色拥有菜单,id数组", hidden = false)
    private List<String> menus;

    public List<String> getMenus() {
        return menus;
    }

    public void setMenus(List<String> menus) {
        this.menus = menus;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id == null ? null : id.trim();
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name == null ? null : name.trim();
    }

    public String getEnname() {
        return enname;
    }

    public void setEnname(String enname) {
        this.enname = enname == null ? null : enname.trim();
    }

    public String getUseable() {
        return useable;
    }

    public void setUseable(String useable) {
        this.useable = useable == null ? null : useable.trim();
    }

    public String getParentId() {
        return parentId;
    }

    public void setParentId(String parentId) {
        this.parentId = parentId == null ? null : parentId.trim();
    }
}